import {getGoods} from "http"
export default {
    state:{
        goods:{}
    },
    mutations:{
        //goods 是 mutations的载荷 来至于actions
        getGoods(state,goods){
            state.goods = goods
        }
    },
    actions:{
        //options 是 action的载荷 来至于组件
        async getGoods({commit},options){
            const {code,data} = await getGoods(options);
            if(code === 200){
                commit("getGoods",data)
            }
        }
    }
}
